home *** CD-ROM | disk | FTP | other *** search
- package test.ui;
-
- import java.awt.Button;
- import java.awt.Component;
- import java.awt.Container;
- import java.awt.Frame;
- import java.awt.GridBagConstraints;
- import java.awt.GridBagLayout;
- import java.awt.Insets;
- import java.awt.SystemColor;
- import java.awt.TextArea;
- import java.awt.Window;
- import java.awt.event.ActionEvent;
- import java.awt.event.ActionListener;
- import java.awt.event.WindowEvent;
- import java.awt.event.WindowListener;
- import java.io.PrintWriter;
- import java.io.StringWriter;
- import java.lang.reflect.Constructor;
- import java.util.EventObject;
-
- class TraceFrame extends Frame implements ActionListener, WindowListener {
- private Button ivjCloseButton;
- private TextArea ivjStackTextArea;
- // $FF: synthetic field
- static Class class$java$awt$Window;
-
- public TraceFrame() {
- this.initialize();
- }
-
- public TraceFrame(String title) {
- super(title);
- }
-
- public void actionPerformed(ActionEvent e) {
- if (((EventObject)e).getSource() == this.getCloseButton()) {
- this.conn1(e);
- }
-
- }
-
- private void conn0(WindowEvent arg1) {
- try {
- ((Frame)this).dispose();
- } catch (Throwable ivjExc) {
- this.handleException(ivjExc);
- }
-
- }
-
- private void conn1(ActionEvent arg1) {
- try {
- ((Frame)this).dispose();
- } catch (Throwable ivjExc) {
- this.handleException(ivjExc);
- }
-
- }
-
- private Button getCloseButton() {
- if (this.ivjCloseButton == null) {
- try {
- this.ivjCloseButton = new Button();
- this.ivjCloseButton.setName("CloseButton");
- this.ivjCloseButton.setLabel("Close");
- } catch (Throwable ivjExc) {
- this.handleException(ivjExc);
- }
- }
-
- return this.ivjCloseButton;
- }
-
- private TextArea getStackTextArea() {
- if (this.ivjStackTextArea == null) {
- try {
- this.ivjStackTextArea = new TextArea();
- this.ivjStackTextArea.setName("StackTextArea");
- this.ivjStackTextArea.setRows(10);
- this.ivjStackTextArea.setColumns(60);
- } catch (Throwable ivjExc) {
- this.handleException(ivjExc);
- }
- }
-
- return this.ivjStackTextArea;
- }
-
- private void handleException(Throwable exception) {
- }
-
- private void initConnections() {
- ((Window)this).addWindowListener(this);
- this.getCloseButton().addActionListener(this);
- }
-
- private void initialize() {
- GridBagConstraints constraintsStackTextArea = new GridBagConstraints();
- GridBagConstraints constraintsCloseButton = new GridBagConstraints();
- ((Component)this).setName("TraceFrame");
- ((Component)this).setName("TraceFrame");
- ((Container)this).setLayout(new GridBagLayout());
- ((Component)this).setBackground(SystemColor.control);
- ((Component)this).setSize(403, 236);
- ((Frame)this).setTitle("Stack Trace");
- constraintsStackTextArea.gridx = 0;
- constraintsStackTextArea.gridy = 0;
- constraintsStackTextArea.gridwidth = 1;
- constraintsStackTextArea.gridheight = 1;
- constraintsStackTextArea.fill = 1;
- constraintsStackTextArea.anchor = 10;
- constraintsStackTextArea.weightx = (double)1.0F;
- constraintsStackTextArea.weighty = (double)1.0F;
- constraintsStackTextArea.insets = new Insets(8, 8, 8, 8);
- ((GridBagLayout)((Container)this).getLayout()).setConstraints(this.getStackTextArea(), constraintsStackTextArea);
- ((Container)this).add(this.getStackTextArea());
- constraintsCloseButton.gridx = 0;
- constraintsCloseButton.gridy = 1;
- constraintsCloseButton.gridwidth = 1;
- constraintsCloseButton.gridheight = 1;
- constraintsCloseButton.anchor = 13;
- constraintsCloseButton.weightx = (double)0.0F;
- constraintsCloseButton.weighty = (double)0.0F;
- constraintsCloseButton.insets = new Insets(0, 8, 8, 8);
- ((GridBagLayout)((Container)this).getLayout()).setConstraints(this.getCloseButton(), constraintsCloseButton);
- ((Container)this).add(this.getCloseButton());
- this.initConnections();
- }
-
- public static void main(String[] args) {
- try {
- TraceFrame aTraceFrame = new TraceFrame();
-
- try {
- Class aCloserClass = Class.forName("uvm.abt.edit.WindowCloser");
- Class[] parmTypes = new Class[]{class$java$awt$Window != null ? class$java$awt$Window : (class$java$awt$Window = class$("java.awt.Window"))};
- Object[] parms = new Object[]{aTraceFrame};
- Constructor aCtor = aCloserClass.getConstructor(parmTypes);
- aCtor.newInstance(parms);
- } catch (Throwable var6) {
- }
-
- ((Component)aTraceFrame).setVisible(true);
- } catch (Throwable var7) {
- System.err.println("Exception occurred in main() of java.awt.Frame");
- }
-
- }
-
- public void showTrace(Throwable t) {
- StringWriter stringWriter = new StringWriter();
- PrintWriter writer = new PrintWriter(stringWriter);
- t.printStackTrace(writer);
- StringBuffer buffer = stringWriter.getBuffer();
- this.getStackTextArea().setText(buffer.toString());
- }
-
- public void windowActivated(WindowEvent e) {
- }
-
- public void windowClosed(WindowEvent e) {
- }
-
- public void windowClosing(WindowEvent e) {
- if (((EventObject)e).getSource() == this) {
- this.conn0(e);
- }
-
- }
-
- public void windowDeactivated(WindowEvent e) {
- }
-
- public void windowDeiconified(WindowEvent e) {
- }
-
- public void windowIconified(WindowEvent e) {
- }
-
- public void windowOpened(WindowEvent e) {
- }
-
- // $FF: synthetic method
- static Class class$(String class$) {
- try {
- return Class.forName(class$);
- } catch (ClassNotFoundException forName) {
- throw new NoClassDefFoundError(((Throwable)forName).getMessage());
- }
- }
- }
-